﻿#include "sysdiskmonitor.h"
#include "systemmonitormanager.h"
#include "syscfg.h"
#include "common.h"

SysDiskMonitor::SysDiskMonitor(SystemMonitorManager * manager):manager(manager)
{

}

int SysDiskMonitor::start()
{
    while(state == RunableStateStarted)
    {
        list<DiskInfo> diskInfos = getWin_DiskUsage();
        manager->updateCurrentDiskUsage(diskInfos);

        int interval = DISK_CHECK_INTERVAL_SECONDS;

        for(int i = 0; i < interval*5; i ++)
        {
            if(state == RunableStateStarted)
            {

                Sleep(200);

            }
            else
            {
                break;
            }
        }
    }

    return f_success;
}
